package com.matt.docpro.model;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Date;

/**
 * Patient
 * Created by  on 2024/02/20.
 */
@Data
public class Doctor {
    String id;
    String name;
    String icon;
    String gender;
    Date birth;
    int age;
    String intro;
    String phone;
    String mail;
    int level;
    String clinicId;
    String clinicNm;
    int reviewCount;
    int avgLevel;
    int stage;
    boolean isLeave;
    int appCount;

    public String getFormatGender() {
        if (gender == null) {
            return "";
        }
        return gender.equals("1") ? "男" : "女";
    }

    public String getFormatBirth() {
        if (birth == null) {
            return "";
        }
        return DateUtil.format(birth, "yyyy/MM/dd");
    }

    public String getFormatStage() {
        switch (stage) {
            case 0:
                return "上午";
            case 1:
                return "下午";
            case 2:
                return "夜间";
            case 3:
                return "昼夜";
            default:
                return "无排班";
        }
    }

    public String getFormatAppBtnText() {
        if (isLeave) {
            return "请假";
        } else if (appCount < 30) {
            return "有号";
        } else {
            return "号满";
        }
    }

    public String getFormatLevel() {
        switch (level) {
            case 0:
                return "医师";
            case 1:
                return "主治医师";
            case 2:
                return "副主任医师";
            case 3:
                return "主任医师";
            default:
                return "医师";
        }
    }
}
